import request from '@/utils/request'

export const getAdList = () => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdList'
  })
}

// xiugai
export const saveOrUpdate = data => {
  return request({
    method: 'POST',
    url: '/front/ad/saveOrUpdate',
    data
  })
}

// 获取所有的广告位
export const getAllSpaces = () => {
  return request({
    method: 'GET',
    url: '/front/ad/space/getAllSpaces'
  })
}

// getAdById
export const getAdById = id => {
  return request({
    method: 'GET',
    url: `/front/ad/getAdById?id=${id}`
  })
}
